define([], function(){
	var tpl = {};
	
	tpl.init = function(domId){
		var html = navbar();
		$("#"+domId).html(html);
	}
	
	var navbar = function(){
		return 	'<script id="tpl_navbar" type="text/html">'+
				'	{{each navs as nav i}}'+
				'		{{if i==0&&(nav.childrens==null||nav.childrens.length==0)}}'+
				'			<li class="active">'+
				'		{{else}}'+
				'			<li>'+
				'		{{/if}}'+
				'			<a data-name="{{nav.id}}" data-id="{{nav.id}}">'+
				'				<i class="{{nav.icon}}"></i>'+
				'				<span>{{nav.name}}</span>'+
				'				<i class=""></i>'+
				'			</a>'+
				'		</li>'+
				'	{{/each}}'+
			    '</script>';
	}
	return tpl;
});